home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / messages / src / addport.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.4 KB  |  71 lines

  1. /*
  2.     $Id$
  3.     $Log$
  4.     Desc:
  5.     Lang: english
  6. */
  7. #include "exec_intern.h"
  8. #include <exec/ports.h>
  9.  
  10. /*****************************************************************************
  11.  
  12.     NAME */
  13.     #include <clib/exec_protos.h>
  14.  
  15.     __AROS_LH1(void, AddPort,
  16.  
  17. /*  SYNOPSIS */
  18.     __AROS_LA(struct MsgPort *, port, A1),
  19.  
  20. /*  LOCATION */
  21.     struct ExecBase *, SysBase, 59, Exec)
  22.  
  23. /*  FUNCTION
  24.     Add a port to the public port list. The ln_Name and ln_Pri fields
  25.     must be initialized prior to calling this function, while
  26.     the port itself is reinitialized before adding. Therefore it's
  27.     not allowed to add an active port.
  28.  
  29.     INPUTS
  30.     port - Pointer to messageport structure.
  31.  
  32.     RESULT
  33.  
  34.     NOTES
  35.  
  36.     EXAMPLE
  37.  
  38.     BUGS
  39.  
  40.     SEE ALSO
  41.  
  42.     INTERNALS
  43.  
  44.     HISTORY
  45.     29-10-95    digulla automatically created from
  46.                 exec_lib.fd and clib/exec_protos.h
  47.  
  48. *****************************************************************************/
  49. {
  50.     __AROS_FUNC_INIT
  51.  
  52.     /* Yes, this is a messageport */
  53.     port->mp_Node.ln_Type=NT_MSGPORT;
  54.  
  55.     /* Clear the list of messages */
  56.     port->mp_MsgList.lh_Head=(struct Node *)&port->mp_MsgList.lh_Tail;
  57.     port->mp_MsgList.lh_Tail=NULL;
  58.     port->mp_MsgList.lh_TailPred=(struct Node *)&port->mp_MsgList.lh_Head;
  59.  
  60.     /* Arbitrate for the list of messageports. */
  61.     Forbid();
  62.  
  63.     /* And add the actual port */
  64.     Enqueue(&SysBase->PortList,&port->mp_Node);
  65.  
  66.     /* All done */
  67.     Permit();
  68.  
  69.     __AROS_FUNC_EXIT
  70. } /* AddPort */
  71.